package implementation.data.records;


import implementation.server.IReadOnlyPost;

public class CPostRecord implements IReadOnlyPost, Cloneable{

	private String _postTopic;
	private String _content;
	private int _authorId;
	private int _postId;
	private int _forumID;
	private int _threadID;

	
	public CPostRecord(int postId, String postTopic, String postcontent, int authorID, int threadID, int forumID){
		this._authorId = authorID;
		this._content = postcontent;
		this._postTopic = postTopic;
		this._postId = postId;
		this._forumID = forumID;
		this._threadID = threadID;
	}
	
	public String getTopic(){
		return this._postTopic;
	}
	public String getContent(){
		return this._content;
	}
	public int getAuthorID(){
		return this._authorId;
	}
	public int getpostID(){
		return this._postId;
	}
	
	
	public void editPostContent(String newPostContent){
		this._content= newPostContent;
	}
	
	public void editPostTopic(String newPostTopic){
		this._postTopic= newPostTopic;
	}
	
	
	public String toString(){
		String tAnswer="Post Id: "+this._postId+"\n"+"Post Topic: "+ this._postTopic+"\n" + "Content: "+ this._content+"\n"+ "Author: "+ this._authorId+ "\n";
		
		return tAnswer;
	}
	
	public CPostRecord clone(){
		return new CPostRecord(this._postId, this._postTopic, this._content, this._authorId,this._threadID,this._forumID);
		
		
	}

	@Override
	public int getID() {
		return this._postId;
	}

	@Override
	public int getThreadID() {
		return this._threadID;
	}

	@Override
	public int getForumID() {
		return this._forumID;
	}
}
